<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改订单')" />
	<th:block th:include="include :: ztree-css" />
</head>
<!--1-->
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-order-edit" th:object="${order}">
			<input id="id" name="id" type="hidden" th:field="*{id}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label ">订单名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="name" th:field="*{name}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">数量：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="count" id="count" th:field="*{count}" required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<input id="remark" name="remark" class="form-control" type="text" th:field="*{remark}">
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: ztree-js" />
	<script type="text/javascript">

		function edit() {
			var id = $("input[name='id']").val();
			var name = $("input[name='name']").val();
			var count = $("input[name='count']").val();
			var remark = $("input[name='remark']").val();
			$.ajax({
				cache : true,
				type : "POST",
				url : ctx + "sale/order/edit",
				data : {
					"id": id,
					"name": name,
					"count": count,
					"remark": remark,
				},
				async : false,
				error : function(request) {
					$.modal.alertError("系统错误");
				},
				success : function(data) {
					$.operate.successCallback(data);
				}
			});
		}
		
		function submitHandler() {

	        	edit();

	    }
	</script>
</body>
</html>
